package com.flyiu.data.consistency.context;

import com.flyiu.data.consistency.model.DistributedTransactionInstance;

/**
 * 分布式事务上下文
 * @author chenjh
 *
 */
public class DistributedTransactionContext {

	private static ThreadLocal<DistributedTransactionInstance> instance = new ThreadLocal<DistributedTransactionInstance>();
	
	public static DistributedTransactionInstance getInstance(){
		return instance.get();
	}
	
	public static  void setInstance(DistributedTransactionInstance ins){
		instance.set(ins);
	}
	
	public static void clear(){
		instance.remove();
	}
	
}
